package com.ruoyi.enterprise.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.enterprise.mapper.ComTxHistoryMapper;
import com.ruoyi.enterprise.domain.ComTxHistory;
import com.ruoyi.enterprise.service.IComTxHistoryService;

/**
 * 本金计算Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-07
 */
@Service
public class ComTxHistoryServiceImpl implements IComTxHistoryService 
{
    @Autowired
    private ComTxHistoryMapper comTxHistoryMapper;

    /**
     * 查询本金计算
     * 
     * @param id 本金计算主键
     * @return 本金计算
     */
    @Override
    public ComTxHistory selectComTxHistoryById(Long id)
    {
        return comTxHistoryMapper.selectComTxHistoryById(id);
    }

    /**
     * 查询本金计算列表
     * 
     * @param comTxHistory 本金计算
     * @return 本金计算
     */
    @Override
    public List<ComTxHistory> selectComTxHistoryList(ComTxHistory comTxHistory)
    {
        return comTxHistoryMapper.selectComTxHistoryList(comTxHistory);
    }

    /**
     * 新增本金计算
     * 
     * @param comTxHistory 本金计算
     * @return 结果
     */
    @Override
    public int insertComTxHistory(ComTxHistory comTxHistory)
    {
        comTxHistory.setCreateTime(DateUtils.getNowDate());
        return comTxHistoryMapper.insertComTxHistory(comTxHistory);
    }

    /**
     * 修改本金计算
     * 
     * @param comTxHistory 本金计算
     * @return 结果
     */
    @Override
    public int updateComTxHistory(ComTxHistory comTxHistory)
    {
        comTxHistory.setUpdateTime(DateUtils.getNowDate());
        return comTxHistoryMapper.updateComTxHistory(comTxHistory);
    }

    /**
     * 批量删除本金计算
     * 
     * @param ids 需要删除的本金计算主键
     * @return 结果
     */
    @Override
    public int deleteComTxHistoryByIds(Long[] ids)
    {
        return comTxHistoryMapper.deleteComTxHistoryByIds(ids);
    }

    /**
     * 删除本金计算信息
     * 
     * @param id 本金计算主键
     * @return 结果
     */
    @Override
    public int deleteComTxHistoryById(Long id)
    {
        return comTxHistoryMapper.deleteComTxHistoryById(id);
    }
}
